//
//  ZLImageView.swift
//  ZLUIKit_Example
//
//  Created by itzhaolei on 2021/8/26.
//  Copyright © 2021 CocoaPods. All rights reserved.
//

import UIKit

open class ZLImageView: UIImageView {
    
    /// 图片
    public convenience init(frame: CGRect?, placeholder: UIImage?, action: Action?) {
        self.init(frame: frame ?? .zero)
        self.image = placeholder
        guard let action = action else { return }
        isUserInteractionEnabled = true
        addGestureRecognizer(UITapGestureRecognizer(target: action.target, action: action.action))
    }
    
    /// 图标
    convenience init(icon: UIImage) {
        self.init(image: icon)
    }
    
}
